﻿using System.Diagnostics;
using Windows.ApplicationModel.Resources;

namespace WinRTToolkit.Resources
{
    public static class ResourceHelper
    {
        #region Static Member

        private static ResourceLoader _resourceLoader;

        #endregion

        #region Constructor

        static ResourceHelper()
        {
            _resourceLoader = new ResourceLoader();
        }

        #endregion

        #region Public Method

        public static string GetString(string resourceName)
        {
            var result = _resourceLoader.GetString(resourceName);

#if DEBUG

            if (string.IsNullOrWhiteSpace(result) == true)
                Debug.WriteLine(string.Format("[ResourceHelper] Resource '{0}' not found.", resourceName));

#endif

            return result;
        }

        #endregion
    }
}
